home *** CD-ROM | disk | FTP | other *** search
/ NetNews Offline 2 / NetNews Offline Volume 2.iso / news / comp / lang / c-part2 / 10303 < prev    next >
Encoding:
Internet Message Format  |  1996-08-05  |  1.3 KB

  1. Path: erich.triumf.ca!bennett
  2. From: bennett@erich.triumf.ca (P.Bennett)
  3. Newsgroups: comp.lang.c
  4. Subject: Re: CONVERTING INTEGER TO ASCII??????
  5. Date: 16 Mar 1996 09:55 PST
  6. Organization: TRIUMF: Tri-University Meson Facility
  7. Distribution: world
  8. Message-ID: <16MAR199609550235@erich.triumf.ca>
  9. References: <4i17r9$2kn@maltese.eag.unisysgsg.com> <4i1cvg$1cg@solutions.solon.com> <4ic5kp$d0g@athos.cc.bellcore.com>
  10. NNTP-Posting-Host: erich.triumf.ca
  11. News-Software: VAX/VMS VNEWS 1.50    
  12.  
  13. In article <4ic5kp$d0g@athos.cc.bellcore.com>, "Sandeep V. Tamhankar" <stamhank@notes.cc.bellcore.com> writes...
  14.  
  15. >Another way to convert integer to ASCII is to add char '0' to your 
  16. >integer.  Like so:
  17. >             int asc;
  18. >             asc= known_int + '0';
  19. >This way, you don't have to load any function and there is no overhead.
  20.  
  21. But this only works for 10 of the (at least) 65,536 possible integer values.
  22.  
  23.  
  24.  
  25. Peter Bennett VE7CEI                | Vessels shall be deemed to be in sight
  26. Internet: bennett@triumf.ca         | of one another only when one can be
  27. Packet: ve7cei@ve7kit.#vanc.bc.ca   | observed visually from the other
  28. TRIUMF, Vancouver, B.C., Canada     |                          ColRegs 3(k)
  29. GPS and NMEA info and programs: ftp://sundae.triumf.ca/pub/peter/index.html
  30. or: ftp://ftp-i2.informatik.rwth-aachen.de/pub/arnd/GPS/peter/index.html
  31.  
  32.